[IA64] Work around auto-ballooning changes.
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Mon, 22 May 2006 16:30:25 +0000 (17:30 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Mon, 22 May 2006 16:30:25 +0000 (17:30 +0100)
Original patch from Kevin Tian at Intel.
Signed-off-by: Keir Fraser <keir@xensource.com>
tools/python/xen/xend/XendDomainInfo.py
tools/python/xen/xend/image.py

index 029c0c969c67684f500d9c027bf701ebeeea968e..8be996c5a23a41358423bb5f331ebf9bbc3a3c75 100644 (file)
@@ -29,6 +29,7 @@ import logging
 import string
 import time
 import threading
+import os
 
 import xen.lowlevel.xc
 from xen.util import asserts
@@ -1264,7 +1265,14 @@ class XendDomainInfo:
             m = self.image.getDomainMemory(self.info['memory'] * 1024)
             balloon.free(m)
             xc.domain_setmaxmem(self.domid, m)
-            xc.domain_memory_increase_reservation(self.domid, self.info['memory'] * 1024, 0, 0)
+
+            init_reservation = self.info['memory'] * 1024
+            if os.uname()[4] == 'ia64':
+                # Workaround until ia64 properly supports ballooning.
+                init_reservation = m
+
+            xc.domain_memory_increase_reservation(self.domid, init_reservation,
+                                                  0, 0)
 
             self.createChannels()
 
index 6d2da07cd6008d816aa6be474b1423a62cec2a9f..98c5ec37791a8d7c698c46dbdfb66cd6206ff1c6 100644 (file)
@@ -144,10 +144,13 @@ class ImageHandler:
 
     def getDomainMemory(self, mem_kb):
         """@return The memory required, in KiB, by the domain to store the
-        given amount, also in KiB.  This is normally just mem, but if HVM is
-        supported, keep a little extra free."""
-        if 'hvm' in xc.xeninfo()['xen_caps']:
-            mem_kb += 4*1024;
+        given amount, also in KiB."""
+        if os.uname()[4] != 'ia64':
+            # A little extra because auto-ballooning is broken w.r.t. HVM
+            # guests. Also, slack is necessary for live migration since that
+            # uses shadow page tables.
+            if 'hvm' in xc.xeninfo()['xen_caps']:
+                mem_kb += 4*1024;
         return mem_kb
 
     def buildDomain(self):